using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace IEeee
{
    class IEeeeException : ApplicationException
    {
        public IEeeeException (String msg) : base (msg) { }

        public delegate void DisplayErrorInvoker(IWin32Window owner, Exception exception);

        public static void DisplayError(IWin32Window owner, Exception exception)
        {
            DisplayError(owner, "The following error occurred", exception);
        }

        public static void DisplayError(IWin32Window owner, String message, Exception exception)
        {
#if DEBUG
            String errMsg = exception.ToString ();
#else
            String errMsg = exception.Message;
#endif

            MessageBox.Show (owner,
                             message + ":\n" + errMsg,
                             "IEeee!",
                             MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
        }
    }
}
